// 驼峰转下划线
export function humpToUnderline(str) {
  return str.replace(/([A-Z])/g, '_$1').toLowerCase()
}

// 下划线转驼峰
export function underlineToHump(s) {
  const a = s.split('_')
  let result = a[0]
  for (let i = 1; i < a.length; i++) {
    result = result + a[i].slice(0, 1).toUpperCase() + a[i].slice(1)
  }
  return result
}
